package com.yanqu.road.server.cmd.banquet.goodbanquet;

import com.yanqu.road.pb.banquet.CrossBanquetProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.banquet.baifubanquet.CrossGoodBanquetMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

/**
 * @Description
 * @Author cwq
 * @Data 2021/11/18 16:14
 */
@Cmd(code = Protocol.C2_GOOD_BANQUET_GET_OPEN_TIME, desc = "获取玩家可以赴百福宴的集合中，结束时间最长的宴会结束时间")
public class CrossGoodBanquetGetOpenTimeCmd extends CrossCommand {

    private long userId;
    private int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        CrossBanquetProto.GoodBanquetGetOpenTimeCrossReqMsg reqMsg = CrossBanquetProto.GoodBanquetGetOpenTimeCrossReqMsg.parseFrom(packet.getBytes());
        userId = packet.getPlayerId();
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossGoodBanquetMgr.getCanJoinOpenTime(activityId,serverId,userId);
    }

    @Override
    public void sendData() {

    }
}
